package com.github.prontera.config;

import org.quartz.SchedulerException;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;

/**
 * @author Alex
 */
@Configuration
public class QuartzBeanConfiguration {

	@Bean
	public SchedulerFactoryBean getSchedulerFactoryBean() throws SchedulerException {
		SchedulerFactoryBean factoryBean = new SchedulerFactoryBean();
		factoryBean.setConfigLocation(new ClassPathResource("quartz.properties"));
		// factoryBean.setStartupDelay(500);
		factoryBean.setAutoStartup(true);
		return factoryBean;
	}

}
